package com.foxmail.aroundme.boring.module.news.main.module;


import com.foxmail.aroundme.boring.bean.newslist.NewsListBean;
import com.foxmail.aroundme.boring.callback.RequestCallback;
import com.foxmail.aroundme.boring.module.news.main.presenter.INewsPre;
import com.foxmail.aroundme.boring.utils.m_enum.RefreshType;

import java.util.List;

import rx.Observable;
import rx.Subscriber;
import rx.Subscription;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action0;

/**
 * Created by gzl on 12/19/16.
 */

public class NewsInterImpl implements INewsInter{

    private INewsPre iNewsPre;

    public NewsInterImpl(INewsPre iNewsPre) {

        this.iNewsPre = iNewsPre;
    }

    @Override
    public Subscription getJoke(final RequestCallback<List<NewsListBean>> callback, @RefreshType.Refresh int type, boolean isRefersh) {
        return Observable.create(new Observable.OnSubscribe<List<NewsListBean>>() {
            @Override
            public void call(Subscriber<? super List<NewsListBean>> subscriber) {
            }
        }).doOnSubscribe(new Action0() {
            @Override
            public void call() {

            }
        }).subscribeOn(AndroidSchedulers.mainThread()).subscribe(new Subscriber<List<NewsListBean>>() {
            @Override
            public void onCompleted() {

            }

            @Override
            public void onError(Throwable e) {

            }

            @Override
            public void onNext(List<NewsListBean> jokes) {

            }
        });
    }
}
